package com.rentcars.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rentcars.entity.Baclist;
import com.rentcars.mapper.BaclistMapper;
import com.rentcars.service.BacListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 任梦强
 */
@Service("BacListService")
public class BacListServiceImpl implements BacListService {

    @Autowired
    private BaclistMapper baclistMapper;

    @Override
    public PageInfo<Baclist> selectBacList(Baclist baclist,Integer curr, Integer pageSize) {
        PageHelper.startPage(curr,pageSize);
        List<Baclist>bacLists=baclistMapper.selectBacList(baclist);
        return new PageInfo<Baclist>(bacLists);
    }

    @Override
    public int insertSelective(Baclist baclist) {
        return baclistMapper.insertSelective(baclist);
    }

    @Override
    public Baclist selectById(String bid) {
        return baclistMapper.selectById(bid);
    }

    @Override
    public int updateByPrimaryKey(Baclist baclist) {
        return baclistMapper.updateByPrimaryKey(baclist);
    }

    @Override
    public int deleteByPrimaryKey(String bid) {
        return baclistMapper.deleteByPrimaryKey(bid);
    }

    @Override
    public int deleteBacList(List<String> bidList) {
        return baclistMapper.deleteBacList(bidList);
    }

    public BaclistMapper getBaclistMapper() {
        return baclistMapper;
    }

    public void setBaclistMapper(BaclistMapper baclistMapper) {
        this.baclistMapper = baclistMapper;
    }
}
